home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #11 / Commodore_Disk_User_Vol.4_11_1991_-.d64 / budget calc (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  12KB  |  385 lines

  1. 100 rem *******************************
  2. 110 rem * budget calc   by s.phillips *
  3. 120 rem *******************************
  4. 130 poke808,239:rem disables run/stop
  5. 140 iflo=1thengosub2920:gosub2640:goto590
  6. 150 poke53280,9:poke53281,9:poke646,7:printchr$(142):gosub160:gosub180:goto190
  7. 160 print"[147]    b u d g e t    p r o g r a m m e":pe=1
  8. 170 print"[197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197]":return
  9. 180 print"written by:   simon phillips":return
  10. 190 print"please key in present month"
  11. 200 print"month: [164] [164] [164]"
  12. 210 qt=16:qu$="":an$="":ft=0:op=0:pe$="actual"
  13. 220 getqu$:ifqu$=""then220
  14. 230 print"[145]"tab(qt)qu$
  15. 240 an$=an$+qu$:qt=qt+2:ft=ft+1:ifft=3then260
  16. 250 goto220
  17. 260 ifan$="jan"thenop=1
  18. 270 ifan$="feb"thenop=2
  19. 280 ifan$="mar"thenop=3
  20. 290 ifan$="apr"thenop=4
  21. 300 ifan$="may"thenop=5
  22. 310 ifan$="jun"thenop=6
  23. 320 ifan$="jul"thenop=7
  24. 330 ifan$="aug"thenop=8
  25. 340 ifan$="sep"thenop=9
  26. 350 ifan$="oct"thenop=10
  27. 360 ifan$="nov"thenop=11
  28. 370 ifan$="dec"thenop=12
  29. 380 ifop=0orop=13thenan$="":qt=16:ft=0:print"[145][145][145]":goto200
  30. 390 print"press  space bar [146] to commence loading":mz$=an$
  31. 400 geta$:ifa$=" "then420
  32. 410 goto400
  33. 420 print"[147]loading  budget  data"
  34. 430 open2,8,2,"0:budget data,s,r":input#2,sr:input#2,cm:am=0
  35. 440 dimh(200),h$(200),y(200),y$(200),hm(20),hm$(20),ym(20),ym$(20),hs(25)
  36. 450 dimhs$(25),ys(25),ys$(25),v(200)
  37. 460 dimm$(20),m(20),s$(20),s(20),f$(200),f(200),fz(200),fz$(200),sr$(20),ss$(20)
  38. 470 dimsu$(20),sr(20),ss(20),su(20),ba$(30),bb$(30),bc$(30),ba(30),bb(30),j$(30)
  39. 480 dimbc(30),st$(20),mt$(20),mt(20),st(20),nb(20),nc(20),gt(10),r(99):fora=1to192
  40. 490 input#2,y$(a):y$=mid$(y$(a),2):y(a)=val(y$):nexta
  41. 500 fora=1to192:input#2,h$(a):h$=mid$(h$(a),2):h(a)=val(h$):nexta:gosub2920:gosub2640
  42. 510 forb=1to12:input#2,sr$(b):sr$=mid$(sr$(b),2):sr(b)=val(sr$)
  43. 520 input#2,ss$(b):ss$=mid$(ss$(b),2):ss(b)=val(ss$)
  44. 530 input#2,su$(b):su$=mid$(su$(b),2):su(b)=val(su$)
  45. 540 nextb:forc=1to16
  46. 550 input#2,ba$(c):ba$=mid$(ba$(c),2):ba(c)=val(ba$)
  47. 560 input#2,bb$(c):bb$=mid$(bb$(c),2):bb(c)=val(bb$)
  48. 570 input#2,bc$(c):bc$=mid$(bc$(c),2):bc(c)=val(bc$)
  49. 580 nextc:input#2,gt(1):input#2,gt(2):input#2,gt(3):close2
  50. 590 sm$="sub [205] month":st$="subt":mt$="monthly tot":mi=12
  51. 600 open3,8,3,"0:budget subjects,s,r"
  52. 610 forfi=1to16
  53. 620 input#3,j$(fi):s$(fi)=mid$(j$(fi),1,mi):input#3,nb(fi):input#3,nc(fi)
  54. 630 nextfi
  55. 640 close3
  56. 650 gosub660:goto720
  57. 660 forgh=1to192
  58. 670 ify$(gh)="000"theny$(gh)="---"
  59. 680 f$(gh)=y$(gh):f(gh)=y(gh)
  60. 690 nextgh
  61. 700 forgh=1to16:st$(gh)=ys$(gh):st(gh)=ys(gh):nextgh
  62. 710 forgh=1to12:mt$(gh)=ym$(gh):mt(gh)=ym(gh):nextgh:return
  63. 720 open4,8,4,"0:budget months,s,r"
  64. 730 forzz=1to12:input#4,m$(zz):nextzz:close4
  65. 740 ifan$=mid$(m$(1),2,3)andlo=0thencm=cm+1:sr=1:goto3200
  66. 750 la$="":lb$=" ":lc$="  ":ld$="  ":le$="    "
  67. 760 lf$="[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":lk$="":pe$=" actual "
  68. 770 gosub830:gosub780:goto820
  69. 780 print"";
  70. 790 forty=1to19:print"                                       ":nextty
  71. 800 return
  72. 810 gosub830
  73. 820 goto860
  74. 830 pa$(1)="[207][183][183][183][183][183][183][208][207][183][183][183][183][208][146][207][183][183][183][183][183][208][207][183][183][183][208][207][183][183][183][183][183][183][183][183][208]"
  75. 840 pa$(2)="[180]review[167][165]move[167][146][165]amend[167][165]end[167][165]"+pe$+"[167]"
  76. 850 pa$(3)="[204][175][175][175][175][175][175][186][204][175][175][175][175][186][146][204][175][175][175][175][175][186][204][175][175][175][186][204][175][175][175][175][175][175][175][175][186]":return
  77. 860 gosub880
  78. 870 goto940
  79. 880 print"[147]"
  80. 890 print""
  81. 900 print"[207][183][183][183][183][183][183][208][207][183][183][183][183][208][146][207][183][183][183][183][183][208][207][183][183][183][208][207][183][183][183][183][183][183][183][183][208]"
  82. 910 print"[180]review[167][165]move[167][146][165]amend[167][165]end[167][165]"+pe$+"[167]"
  83. 920 print"[204][175][175][175][175][175][175][186][204][175][175][175][175][186][146][204][175][175][175][175][175][186][204][175][175][175][186][204][175][175][175][175][175][175][175][175][186]"
  84. 930 return
  85. 940 print""
  86. 950 gosub780
  87. 960 di=2:s=1:f=1:u=1:m=1:mt=1:ff=f:ss=s:uu=u:mm=m:mu=mt:goto1260
  88. 970 f=ff:s=ss:u=uu:m=mm:mt=mu
  89. 980 sw=1:di=2
  90. 990 az$="":ax$=""
  91. 1000 di=2:print"";az$;lb$;m$(m);la$;m$(m+1);la$;m$(m+2);la$;m$(m+3);lc$;ax$
  92. 1010 print"";lf$
  93. 1020 print"";az$;lb$;f$(f);lb$;f$(f+1);lb$;f$(f+2);lb$;f$(f+3);lc$;ax$
  94. 1030 print"";az$;lb$;f$(f+12);lb$;f$(f+13);lb$;f$(f+14);lb$;f$(f+15);lc$;
  95. 1040 printax$
  96. 1050 print"";az$;lb$;f$(f+24);lb$;f$(f+25);lb$;f$(f+26);lb$;f$(f+27);lc$;
  97. 1060 printax$
  98. 1070 print"";az$;lb$;f$(f+36);lb$;f$(f+37);lb$;f$(f+38);lb$;f$(f+39);lc$;
  99. 1080 printax$
  100. 1090 print"";az$;la$;mt$(mt);la$;mt$(mt+1);la$;mt$(mt+2);la$;mt$(mt+3);ld$;
  101. 1100 printgt$
  102. 1110 goto1390
  103. 1120 sw=1:di=2
  104. 1130 ac$="":av$="":ab$="            ":as$="[157][157][157][157][157][157][157][157][157][157][157][157]"
  105. 1140 di=2:print""
  106. 1150 print"";lf$
  107. 1160 print"";ab$;as$;s$(s);lb$;f$(f);lb$;f$(f+1);lb$;f$(f+2);lb$;f$(f+3);lc$;st$(u)
  108. 1170 print"";ab$;as$;s$(s+1);lb$;f$(f+12);lb$;f$(f+13);lb$;f$(f+14);lb$;f$(f+15);
  109. 1180 printlc$;st$(u+1)
  110. 1190 print"";ab$;as$;s$(s+2);lb$;f$(f+24);lb$;f$(f+25);lb$;f$(f+26);lb$;f$(f+27);
  111. 1200 printlc$;st$(u+2)
  112. 1210 print"";ab$;as$;s$(s+3);lb$;f$(f+36);lb$;f$(f+37);lb$;f$(f+38);lb$;f$(f+39);
  113. 1220 printlc$;st$(u+3)
  114. 1230 print"";az$;la$;ac$;la$;ac$;la$;ac$;la$;ac$;ld$;
  115. 1240 printgt$
  116. 1250 goto1390
  117. 1260 f=ff:s=ss:u=uu:m=mm:mt=mu
  118. 1270 sw=1:di=2:gosub780
  119. 1280 di=2:print"";sm$;lb$;m$(m);la$;m$(m+1);la$;m$(m+2);la$;m$(m+3);lc$;st$
  120. 1290 print"";lf$
  121. 1300 print"";s$(s);lb$;f$(f);lb$;f$(f+1);lb$;f$(f+2);lb$;f$(f+3);lc$;st$(u)
  122. 1310 print"";s$(s+1);lb$;f$(f+12);lb$;f$(f+13);lb$;f$(f+14);lb$;f$(f+15);lc$;
  123. 1320 printst$(u+1)
  124. 1330 print"";s$(s+2);lb$;f$(f+24);lb$;f$(f+25);lb$;f$(f+26);lb$;f$(f+27);lc$;
  125. 1340 printst$(u+2)
  126. 1350 print"";s$(s+3);lb$;f$(f+36);lb$;f$(f+37);lb$;f$(f+38);lb$;f$(f+39);lc$;
  127. 1360 printst$(u+3)
  128. 1370 print"";mt$;la$;mt$(mt);la$;mt$(mt+1);la$;mt$(mt+2);la$;mt$(mt+3);ld$;
  129. 1380 printgt$
  130. 1390 sd=notpeek(56320)and15:fo=peek(56320)and16
  131. 1400 if(sdand1)then1460
  132. 1410 if(sdand2)then1500
  133. 1420 if(sdand4)then1540
  134. 1430 if(sdand8)then1590
  135. 1440 iffo=0then2100
  136. 1450 sd=0:goto1390
  137. 1460 iff=1orf=2orf=3orf=4orf=6orf=7orf=8then1390
  138. 1470 iff=5then1390
  139. 1480 iff=9then1390
  140. 1490 f=f-12:s=s-1:u=u-1:goto1120
  141. 1500 iff=145orf=146orf=147orf=148orf=150orf=151orf=152then1390
  142. 1510 iff=149then1390
  143. 1520 iff=153then1390
  144. 1530 f=f+12:s=s+1:u=u+1:goto1120
  145. 1540 iff=1orf=13orf=25orf=37orf=61orf=73orf=85orf=109orf=121orf=133then1390
  146. 1550 iff=49then1390
  147. 1560 iff=97then1390
  148. 1570 iff=145then1390
  149. 1580 f=f-1:m=m-1:mt=mt-1:goto980
  150. 1590 iff=9orf=21orf=33orf=45orf=69orf=81orf=93orf=117orf=129orf=141then1390
  151. 1600 iff=57then1390
  152. 1610 iff=105then1390
  153. 1620 iff=153then1390
  154. 1630 f=f+1:m=m+1:mt=mt+1:goto980
  155. 1640 ce$="":nu=0:cf=0:cg=0:f=ff:print""f$(f)"[146]":x=0:y=0
  156. 1650 ff=f:ss=s:uu=u:mm=m:mu=mt
  157. 1660 sd=notpeek(56320)and15:fo=peek(56320)and16:y1=y:x1=x
  158. 1670 if(sdand2)theny=y+1:goto1710
  159. 1680 if(sdand1)theny=y-1:goto1710
  160. 1690 if(sdand4)thenx=x-1:goto1710
  161. 1700 if(sdand8)thenx=x+1:goto1710
  162. 1710 ify<0theny=0
  163. 1720 ify>3theny=3
  164. 1730 ifx<0thenx=0
  165. 1740 ifx>3thenx=3
  166. 1750 iffo=0thengosub890:goto1260
  167. 1760 ifx<>x1thengosub1990
  168. 1770 ify<>y1thengosub1990
  169. 1780 print"";:nu=0:forja=1to(y*3)+4:print"";:nextja
  170. 1790 printtab(13+(x*5));
  171. 1800 ify>0thennu=12*y
  172. 1810 nu=nu+x
  173. 1820 print"";f$(f+nu)
  174. 1830 geta$
  175. 1840 fo=peek(56320)and16:iffo=0then1750
  176. 1850 ifa$=""then1890
  177. 1860 ifa$=chr$(13)then1910
  178. 1870 a=asc(a$):ifa>57ora<48then1830
  179. 1880 goto1910
  180. 1890 ifcf=0then1980
  181. 1900 goto1830
  182. 1910 cg=cg+1:ifcg=4thencp$=ce$:ce$=""+ce$:goto2010
  183. 1920 ce$=ce$+a$
  184. 1930 print"";
  185. 1940 print"";:forja=1to(y*3)+4:print"";:nextja
  186. 1950 printtab(14+(x*5));"";ce$
  187. 1960 cf=1:goto1830
  188. 1970 iffo=0then2100
  189. 1980 sd=0:goto1660
  190. 1990 print"";:forja=1to(y1*3)+4:print"";:nextja
  191. 2000 printtab(13+(x1*5));"[146]";f$(f+nu):return
  192. 2010 ifa$=chr$(13)thencf=0:f$(f+nu)=ce$:f(f+nu)=val(cp$):am=1:goto2030
  193. 2020 goto2090
  194. 2030 print"please wait"
  195. 2040 ifpe=1theny$(f+nu)=ce$:y(f+nu)=val(cp$)
  196. 2050 ifpe=0thenh$(f+nu)=ce$:h(f+nu)=val(cp$)
  197. 2060 ifpe=1thengosub2640:gosub660:goto2080
  198. 2070 ifpe=0thengosub2920:gosub3590:goto2080
  199. 2080 gosub830:gosub880:goto1260
  200. 2090 cg=0:ce$="":goto1930
  201. 2100 ff=f:ss=s:uu=u:mm=m:mu=mt
  202. 2110 fo=peek(56320)and16:iffo=0then2110
  203. 2120 f=16:sd=notpeek(56320)and15:fo=peek(56320)and16
  204. 2130 if(sdand1)then2110
  205. 2140 if(sdand2)then2110
  206. 2150 if(sdand4)thendi=di-1:goto2190
  207. 2160 if(sdand8)thendi=di+1:goto2190
  208. 2170 iffo=0then2530
  209. 2180 sd=0:goto2120
  210. 2190 ifdi=0thendi=5:goto2210
  211. 2200 ifdi=6thendi=1
  212. 2210 ondigoto2230,2290,2350,2410,2470
  213. 2220 goto2120
  214. 2230 print""
  215. 2240 print"[207][183][183][183][183][183][183][208][146][207][183][183][183][183][208][207][183][183][183][183][183][208][207][183][183][183][208][207][183][183][183][183][183][183][183][183][208]"
  216. 2250 print"[180]review[167][146][165]move[167][165]amend[167][165]end[167][165]";pe$;"[167]"
  217. 2260 print"[204][175][175][175][175][175][175][186][146][204][175][175][175][175][186][204][175][175][175][175][175][186][204][175][175][175][186][204][175][175][175][175][175][175][175][175][186]"
  218. 2270 fordz=1to100:nextdz
  219. 2280 goto2120
  220. 2290 print""
  221. 2300 print"[207][183][183][183][183][183][183][208][207][183][183][183][183][208][146][207][183][183][183][183][183][208][207][183][183][183][208][207][183][183][183][183][183][183][183][183][208]"
  222. 2310 print"[180]review[167][165]move[167][146][165]amend[167][165]end[167][165]";pe$;"[170]"
  223. 2320 print"[204][175][175][175][175][175][175][186][204][175][175][175][175][186][146][204][175][175][175][175][175][186][204][175][175][175][186][204][175][175][175][175][175][175][175][175][186]"
  224. 2330 fordz=1to100:nextdz
  225. 2340 goto2120
  226. 2350 print""
  227. 2360 print"[207][183][183][183][183][183][183][208][207][183][183][183][183][208][207][183][183][183][183][183][208][146][207][183][183][183][208][207][183][183][183][183][183][183][183][183][208]"
  228. 2370 print"[180]review[167][165]move[167][165]amend[167][146][165]end[167][165]";pe$;"[170]"
  229. 2380 print"[204][175][175][175][175][175][175][186][204][175][175][175][175][186][204][175][175][175][175][175][186][146][204][175][175][175][186][204][175][175][175][175][175][175][175][175][186]"
  230. 2390 fordz=1to100:nextdz
  231. 2400 goto2120
  232. 2410 print""
  233. 2420 print"[207][183][183][183][183][183][183][208][207][183][183][183][183][208][207][183][183][183][183][183][208][207][183][183][183][208][146][207][183][183][183][183][183][183][183][183][208]"
  234. 2430 print"[180]review[167][165]move[167][165]amend[167][165]end[167][146][165]";pe$;"[170]"
  235. 2440 print"[204][175][175][175][175][175][175][186][204][175][175][175][175][186][204][175][175][175][175][175][186][204][175][175][175][186][146][204][175][175][175][175][175][175][175][175][186]"
  236. 2450 fordz=1to100:nextdz
  237. 2460 goto2120
  238. 2470 print""
  239. 2480 print"[207][183][183][183][183][183][183][208][207][183][183][183][183][208][207][183][183][183][183][183][208][207][183][183][183][208][207][183][183][183][183][183][183][183][183][208][146]"
  240. 2490 print"[180]review[167][165]move[167][165]amend[167][165]end[167][165]";pe$;"[170][146]"
  241. 2500 print"[204][175][175][175][175][175][175][186][204][175][175][175][175][186][204][175][175][175][175][175][186][204][175][175][175][186][204][175][175][175][175][175][175][175][175][186][146]"
  242. 2510 fordz=1to100:nextdz
  243. 2520 goto2120
  244. 2530 print""
  245. 2540 ondigoto3480,2600,1640,3470,3500
  246. 2550 end
  247. 2560 gosub2640:di=2:goto2350
  248. 2570 print"[180]review[167][165]move[167][146][165]amend[167][165]end[167][165]";pe$;"[167]"
  249. 2580 print"[204][175][175][175][175][175][175][186][204][175][175][175][175][186][146][204][175][175][175][175][175][186][204][175][175][175][186][204][175][175][175][175][175][175][175][175][186]"
  250. 2590 goto2630
  251. 2600 print"[147]":print""
  252. 2610 print"[207][183][183][183][183][183][183][208][207][183][183][183][183][208][146][207][183][183][183][183][183][208][207][183][183][183][208][207][183][183][183][183][183][183][183][183][208]"
  253. 2620 goto2570
  254. 2630 goto1260
  255. 2640 forer=1to(12*16):ify$(er)="000"theny$(er)="---":nexter
  256. 2650 forty=1to12
  257. 2660 ym(ty)=y(ty)+y(ty+12)+y(ty+24)+y(ty+48)+y(ty+60)+y(ty+72)+y(ty+84)+y(ty+96)
  258. 2670 ym(ty)=ym(ty)+y(ty+108)+y(ty+120)+y(ty+132)+y(ty+144)+y(ty+156)+y(ty+168)
  259. 2680 ym(ty)=ym(ty)+y(ty+36)+y(ty+180):ym$(ty)=str$(ym(ty))
  260. 2690 nextty:zy=0
  261. 2700 forzx=0to15:zz=(zx*12)+1:zy=zy+1
  262. 2710 ys(zy)=y(zz)+y(zz+1)+y(zz+2)+y(zz+3)+y(zz+4)+y(zz+5)+y(zz+6)+y(zz+7)
  263. 2720 ys(zy)=ys(zy)+y(zz+8)+y(zz+9)+y(zz+10)+y(zz+11)
  264. 2730 nextzx
  265. 2740 forty=1to16:ys$(ty)=str$(ys(ty)):nextty
  266. 2750 gt=ym(1)+ym(2)+ym(3)+ym(4)+ym(5)+ym(6)+ym(7)+ym(8)+ym(9)+ym(10)+ym(11)
  267. 2760 gt=gt+ym(12):gt$=str$(gt):gt$=mid$(gt$,2):gt$=""+gt$
  268. 2770 fort=1to16:ym$(t)=mid$(ym$(t),2)
  269. 2780 ifym$(t)="0"thenym$(t)="0000":goto2830
  270. 2790 l=len(ym$(t)):ifl=3thenym$(t)="0"+ym$(t):goto2830
  271. 2800 l=len(ym$(t)):ifl=2thenym$(t)="00"+ym$(t):goto2830
  272. 2810 l=len(ym$(t)):ifl=1thenym$(t)="000"+ym$(t):goto2830
  273. 2820 l=len(ym$(t)):ifl=4thenym$(t)=""+ym$(t):goto2830
  274. 2830 nextt
  275. 2840 fort=1to16:ys$(t)=mid$(ys$(t),2)
  276. 2850 ifys$(t)="0"thenys$(t)="0000":goto2900
  277. 2860 l=len(ys$(t)):ifl=3thenys$(t)="0"+ys$(t):goto2900
  278. 2870 l=len(ys$(t)):ifl=2thenys$(t)="00"+ys$(t):goto2900
  279. 2880 l=len(ys$(t)):ifl=1thenys$(t)="000"+ys$(t):goto2900
  280. 2890 l=len(ys$(t)):ifl=4thenys$(t)=""+ys$(t)
  281. 2900 nextt
  282. 2910 return
  283. 2920 forer=1to(12*16):ifh$(er)="000"thenh$(er)="---":nexter
  284. 2930 forty=1to12
  285. 2940 hm(ty)=h(ty)+h(ty+12)+h(ty+24)+h(ty+48)+h(ty+60)+h(ty+72)+h(ty+84)+h(ty+96)
  286. 2950 hm(ty)=hm(ty)+h(ty+108)+h(ty+120)+h(ty+132)+h(ty+144)+h(ty+156)+h(ty+168)
  287. 2960 hm(ty)=hm(ty)+h(ty+36)+h(ty+180):hm$(ty)=str$(hm(ty))
  288. 2970 nextty:zy=0
  289. 2980 forzx=0to15:zz=(zx*12)+1:zy=zy+1
  290. 2990 hs(zy)=h(zz)+h(zz+1)+h(zz+2)+h(zz+3)+h(zz+4)+h(zz+5)+h(zz+6)+h(zz+7)
  291. 3000 hs(zy)=hs(zy)+h(zz+8)+h(zz+9)+h(zz+10)+h(zz+11)
  292. 3010 nextzx
  293. 3020 forty=1to16:hs$(ty)=str$(hs(ty)):nextty
  294. 3030 gt=hm(1)+hm(2)+hm(3)+hm(4)+hm(5)+hm(6)+hm(7)+hm(8)+hm(9)+hm(10)+hm(11)
  295. 3040 gt=gt+hm(12):gt$=str$(gt):gt$=mid$(gt$,2):gt$=""+gt$:gh$=gt$
  296. 3050 fort=1to16:hm$(t)=mid$(hm$(t),2)
  297. 3060 ifhm$(t)="0"thenhm$(t)="0000":goto3110
  298. 3070 l=len(hm$(t)):ifl=3thenhm$(t)="0"+hm$(t):goto3110
  299. 3080 l=len(hm$(t)):ifl=2thenhm$(t)="00"+hm$(t):goto3110
  300. 3090 l=len(hm$(t)):ifl=1thenhm$(t)="000"+hm$(t):goto3110
  301. 3100 l=len(hm$(t)):ifl=4thenhm$(t)=""+hm$(t):goto3110
  302. 3110 nextt
  303. 3120 fort=1to16:hs$(t)=mid$(hs$(t),2)
  304. 3130 ifhs$(t)="0"thenhs$(t)="0000":goto3180
  305. 3140 l=len(hs$(t)):ifl=3thenhs$(t)="0"+hs$(t):goto3180
  306. 3150 l=len(hs$(t)):ifl=2thenhs$(t)="00"+hs$(t):goto3180
  307. 3160 l=len(hs$(t)):ifl=1thenhs$(t)="000"+hs$(t):goto3180
  308. 3170 l=len(hs$(t)):ifl=4thenhs$(t)=""+hs$(t)
  309. 3180 nextt
  310. 3190 return
  311. 3200 forw=1to193:y(w)=0:h(w)=0:h$(w)="---":y$(w)="---":nextw
  312. 3210 forgh=1to192
  313. 3220 h(gh)=0:ifh(gh)>0thenh(gh)=0
  314. 3230 y(gh)=0:ify(gh)>0theny(gh)=0:nextgh
  315. 3240 fore=1to16
  316. 3250 ifst(e)>0thenst(e)=0
  317. 3260 st$(e)="0000":nexte
  318. 3270 gt(1)=gt(2):gt$(1)=gt$(2)
  319. 3280 gt(2)=gt(3):gt$(2)=gt$(3)
  320. 3290 gt(3)=gt:gt$(3)=gt$
  321. 3300 forgh=1to12
  322. 3310 ym$(gh)="0000":ifym$(gh)<>"0000"thenym$(gh)="0000"
  323. 3320 hm$(gh)="0000":ifhm$(gh)<>"0000"thenhm$(gh)="0000"
  324. 3330 nextgh
  325. 3340 gt=0:gt$="0000"
  326. 3350 forp=1to16
  327. 3360 ys$(p)="0000"
  328. 3370 hs$(p)="0000"
  329. 3380 ys(p)=0000
  330. 3390 hs(p)=0000
  331. 3400 nextp:sr=0
  332. 3410 forp=1to12:hm(p)=0000:hm$(p)="0000":ym(p)=0:ym$(p)="0000":nextp
  333. 3420 f=zq(1):s=zq(2):t=zq(3):m=zq(4):mt=zq(5)
  334. 3430 fortu=1to193:f$(tu)=y$(tu):f(tu)=y(tu):nexttu
  335. 3440 fortu=1to16:st$(tu)=ys$(tu):st(tu)=ys(tu):nexttu
  336. 3450 fortu=1to12:mt$(tu)=ym$(tu):mt(tu)=ym(tu):nexttu
  337. 3460 goto750
  338. 3470 print"please wait":gosub3650:load"bud end",8,1
  339. 3480 print"please wait":gosub3650
  340. 3490 load"bud review",8,1
  341. 3500 print"please wait"
  342. 3510 ifpe=0thenpe=1:pe$=" actual ":gosub2640:goto3560
  343. 3520 ifpe=1thenpe=0:pe$="estimate":gosub2920
  344. 3530 fortu=1to193:f$(tu)=h$(tu):f(tu)=h(tu):nexttu
  345. 3540 fortu=1to16:st$(tu)=hs$(tu):st(tu)=hs(tu):nexttu
  346. 3550 fortu=1to12:mt$(tu)=hm$(tu):mt(tu)=hm(tu):nexttu:goto2600
  347. 3560 fortu=1to193:f$(tu)=y$(tu):f(tu)=y(tu):nexttu
  348. 3570 fortu=1to16:st$(tu)=ys$(tu):st(tu)=ys(tu):nexttu
  349. 3580 fortu=1to12:mt$(tu)=ym$(tu):mt(tu)=ym(tu):nexttu:goto2600
  350. 3590 forgh=1to192
  351. 3600 ifh$(gh)="000"thenh$(gh)="---"
  352. 3610 f$(gh)=h$(gh):f(gh)=h(gh)
  353. 3620 nextgh
  354. 3630 forgh=1to12:st$(gh)=hs$(gh):st(gh)=hs(gh):nextgh
  355. 3640 forgh=1to16:mt$(gh)=hm$(gh):mt(gh)=hm(gh):nextgh:return
  356. 3650 gt=ym(1)+ym(2)+ym(3)+ym(4)+ym(5)+ym(6)+ym(7)+ym(8)+ym(9)+ym(10)+ym(11)
  357. 3660 gt=gt+ym(12):gt$=str$(gt):gt$=mid$(gt$,2):gt$=""+gt$
  358. 3670 open2,8,2,"@0:budget data 2,s,w"
  359. 3680 forty=1to192
  360. 3690 print#2,y$(ty)
  361. 3700 print#2,y(ty)
  362. 3710 nextty
  363. 3720 forty=1to192
  364. 3730 print#2,h$(ty)
  365. 3740 print#2,h(ty)
  366. 3750 nextty
  367. 3760 print#2,gt$
  368. 3770 forty=1to12
  369. 3780 print#2,ym$(ty)
  370. 3790 print#2,ym(ty)
  371. 3800 nextty
  372. 3810 forty=1to12
  373. 3820 print#2,hm$(ty)
  374. 3830 print#2,hm(ty)
  375. 3840 nextty
  376. 3850 forty=1to16
  377. 3860 print#2,ys$(ty)
  378. 3870 print#2,ys(ty)
  379. 3880 nextty
  380. 3890 forty=1to16
  381. 3900 print#2,hs$(ty)
  382. 3910 print#2,hs(ty)
  383. 3920 nextty:close2
  384. 3930 return
  385.